[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
external                 Declares Assembly Language Procedure or Function[TP]

 procedure <pname1>(<parameters>); external <filename>;
 procedure <pname>(<parameters>); external <pname1>[<offset>];
 function  <fname>(<parameters>) : <ftype>; external <pname1>[<offset>];

    Turbo Pascal lets you call assembly language subprograms (procedures
    and functions). You declare these in your Pascal program by giving the
    procedure or function header as you would for a Pascal subprogram,
    followed by an EXTERNAL statement.

         <filename>   The name of a .BIN file containing the machine code
                      of assembly language routines.

           <pname1>   The name of the first routine in <filename>. This
                      need not correspond to the actual name of the
                      assembly language routine; this is the name you will
                      use in your Pascal program.

    <pname>,<fname>   The names of additional routines in <filename>.

           <offset>   The offset (in bytes) of the entry point for that
                      routine from the base address of <filename>.

  -------------------------------- Example ---------------------------------

    The examples below are taken from GRAPH.P, the header file for all
    extended graphics routines. The code for those routines is in the file
    GRAPH.BIN.

           procedure Graphics;                            external
           'GRAPH.BIN';
           procedure Plot(X,Y,Color : Integer);           external
           Graphics[21];
           function GetDotColor(X,Y : Integer) : Integer; external
           Graphics[42];

See Also: procedure function
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson